<?php

/*
 * Copyright 2014 gg.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Description of ClassController
 *
 * @author gg
 */
namespace Wechat\Controller;
use Think\Controller;
class ClassController extends Controller {
    public function index(){
        $key = I('get.key');
        $cla = new \Wechat\Model\ClaModel();
        $classinfo = $cla->getCla($key);
        
        header("Content-type: text/html; charset=utf-8");
        echo "<html><body><meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'>
        <meta name='format-detection' content='telephone=no'/> 
        <style type='text/css'>
		html,body,table,th,td,tr{
		    padding: 0;
		    margin: 0;
		  }
		table,th,td {
		    border-color:#063;
		    border-width: .1em;
		    padding: .1em;
		    border-style: solid;
		}
		table {
		  font-family: verdana,arial,sans-serif;
		  width: 100%;
		  font-size:.7em; 
		  color:#333333;
		  border-collapse: collapse;
		}
		th {
		  padding: .2em;
		  background-color: #029142;
		  font-size: 1em;
		  color: #fff;
		  font-style: bold;
		}
		td {  
		  background-color: #ffffff;
		}
        </style><table>".$classinfo."</table></body></html>";
    }
}
